//onload函数
function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload !='function'){
	window.onload = func;
	}
	else{
	window.onload=function(){
		oldonload();
		func();
	}
}
}

function ajax1()
{
	var xmlhttp;
	if (window.XMLHttpRequest)
	{
		//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		// IE6, IE5 浏览器执行代码
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			document.getElementById("div1").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","publish.html",true);
	xmlhttp.send();
}

addLoadEvent(ajax1);